package com.xjrccb.chapter1.service;
import com.xjrccb.chapter1.helper.DatabaseHelper;
import com.xjrccb.chapter1.model.Customer;
import com.xjrccb.chapter1.util.PropsUtil;

import java.sql.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CustomerService {

	private static final Logger LOGGER= LoggerFactory.getLogger(PropsUtil.class);

	public List<Customer> getCustomerList() {
		String sql="SELECT * FROM customer";
		return DatabaseHelper.queryEntityList(Customer.class, sql);
	}

	public Customer getCustomer(long id) {
		String sql="SELECT * FROM customer where id=?";
		return DatabaseHelper.queryEntity(Customer.class, sql, id);
	}

	public boolean CreateCustomer(Map<String, Object> filedMap) {
		return false;
	}

	public boolean UpdateCustomer(long id, Map<String, Object> fieldMap) {
		return false;
	}

	public boolean DeleteCustomer(long id) {
		return false;
	}
}
